package Tuan11.Bai3;

public class HocSinh {
	private int maHocSinh;
	private String hoTen;
	private int diemTrungBinh;

	public int getMaSinhVien() {
		return this.maHocSinh;
	}

	public void setMaSinhVien(int maSinhVien) {
		this.maHocSinh = maSinhVien;
	}

	public String getHoTen() {
		return this.hoTen;
	}

	public void setHoTen(String hoTen) {
		this.hoTen = hoTen;
	}

	public int getDiemTrungBinh() {
		return this.diemTrungBinh;
	}

	public void setDiemTrungBinh(int diemTrungBinh) {
		this.diemTrungBinh = diemTrungBinh;
	}

	public void input(int maHocSinh, String hoTen, int diemTrungBinh) {
		this.maHocSinh = maHocSinh;
		this.hoTen = hoTen;
		this.diemTrungBinh = diemTrungBinh;
	}

	public String output() {
		String out = "\nThông Tin Học Sinh:";
		out += "\nMã HS:\t\t" + maHocSinh;
		out += "\nTên HS:\t\t" + hoTen;
		out += "\nĐiểm TB:\t" + diemTrungBinh;
		return out;
	}

	public String rank() {
		String rank = "";
		if (diemTrungBinh < 4)
			rank = "Yếu";
		else if (diemTrungBinh < 6)
			rank = "Trung bình";
		else if (diemTrungBinh < 7)
			rank = "Khá";
		else
			rank = "Giỏi";
		return "Xếp loại:\t" + rank;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		HocSinh hs = new HocSinh();
		hs.input(1, "Nguyễn Văn B", 5);
		System.out.println(hs.output());
		System.out.println(hs.rank());
	}
}